﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynamicToSql
{
    public sealed class PropertySelector
    {
        public PropertySelector()
        {
            IncludeProperties = new List<string>();
            ExcludeProperties = new List<string>();
        }

        public PropertySelector Include(params string[] properties)
        {
            foreach (var p in properties)
                Include(p);
            return this;
        }

        public PropertySelector Include(string property)
        {
            if(!IncludeProperties.Contains(property))
                IncludeProperties.Add(property);
            return this;
        }

        public PropertySelector Exclude(params string[] properties)
        {
            foreach (var p in properties)
                Exclude(p);
            return this;
        }

        public PropertySelector Exclude(string property)
        {
            if (!ExcludeProperties.Contains(property))
                ExcludeProperties.Add(property);
            return this;
        }

        internal IList<string> IncludeProperties { get; set; }

        internal IList<string> ExcludeProperties { get; set; }
    }
}
